
/**
 * @author kjj
 *
 */
public class TimeTool {
	
	public long testTime(ICallBack callBack) {
		long begin = System.currentTimeMillis(); //millisecond
		callBack.execute();
		long end = System.currentTimeMillis();
		
		System.out.println("[execution time: ] " + (end - begin) + "ms");
		return (end - begin);
	}

public static void main(String[] args) {
	TimeTool timeTool =new TimeTool();
	long avgTime = 0;
	final int nTimes = 10;
	for (int i = 0; i < nTimes; i++) {
		avgTime += 	timeTool.testTime(new ICallBack() {
			
			@Override
			public void execute() {
				// TODO Auto-generated method stub
				TestExeTime.testedMethod();
			}
		});
	}
	
	System.out.println("[Average execution time:] " + (avgTime/nTimes) + "ms");

}
}
